if (!isBrowser) {
    class NodeList {
        elements: Array<any>;
        constructor(...elements: Array<any>) {
            this.elements = elements;
        }
        get [Symbol.toStringTag]() { return NodeList.name; };
        forEach(fn: (element: HTMLElement) => void): void { this.elements.forEach(fn) };
    }
    Object.defineProperty(globalThis, 'NodeList', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: NodeList
    });
    class HTMLElement {
        querySelector(selectors: string): HTMLElement {
            if (selectors === 'script') { return new HTMLScriptElement(); }
            return new HTMLElement();
        };
        querySelectorAll(selectors: string): NodeList {
            if (selectors === 'script') { return new NodeList(new HTMLScriptElement()); }
            throw new NotImplementedError();
        };
        get [Symbol.toStringTag]() { return HTMLElement.name; };
    }
    Object.defineProperty(globalThis, 'HTMLElement', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: HTMLElement
    });

    class HTMLHeadElement extends HTMLElement {
        outerHTML = '<head></head>';
        get [Symbol.toStringTag]() { return HTMLHeadElement.name; };
    }

    class HTMLScriptElement extends HTMLElement {
        outerHTML = '<script></script>';
        get [Symbol.toStringTag]() { return HTMLScriptElement.name; };
    }

    class HTMLBodyElement extends HTMLElement {
        outerHTML = '<body></body>';
        get [Symbol.toStringTag]() { return HTMLBodyElement.name; };
    }

    const document = {
        head: new HTMLHeadElement(),
        body: new HTMLBodyElement(),
        addEventListener: () => { }
    };
    Object.defineProperty(globalThis, 'document', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: document
    });

    const window = {
        location: {
            href: 'http://127.0.0.1:5500/DOM-simulator.html'
        }
    };
    Object.defineProperty(globalThis, 'window', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: window
    });

    Object.defineProperty(globalThis, 'requestAnimationFrame', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: (callback: Function) => {
            setTimeout(() => {
                callback(performance.now());
            }, 33);
        }
    });
    class MutationObserver {
        observe() { };
    }
    Object.defineProperty(globalThis, 'MutationObserver', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: MutationObserver
    });
    class ResizeObserver {
    }
    Object.defineProperty(globalThis, 'ResizeObserver', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: ResizeObserver
    });
}
